package com.itbour.common.db;

/**
 *
 * copyright pirate alliance team 2014
 *
 * @author xuwei
 *
 */
public class LimitOffsetPagingSqlRewriter
{
	/**
	 * mysql翻页sql
	 * @param baseSQL
	 * @param limit
	 * @param offset
	 * @return
	 */
	public static String makeLimitOffsetSql(String baseSQL, int limit, int offset)
	{
		StringBuffer sqlBuf = new StringBuffer(baseSQL);
		sqlBuf.append(" LIMIT ");
		sqlBuf.append(limit);
		sqlBuf.append(" OFFSET ");
		sqlBuf.append(offset);
		return sqlBuf.toString();
	}
}
